package com.example.es_promotion.document;

import lombok.Data;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;
import java.time.LocalDateTime;
import java.util.List;

@Document(indexName = "promotion_rules")
@Data
public class EsPromotion {
    @Id
    private String id;
    
    @Field(type = FieldType.Long)
    private Long promotionId;
    
    @Field(type = FieldType.Text)
    private String name;
    
    @Field(type = FieldType.Text)
    private String description;
    
    @Field(type = FieldType.Date)
    private LocalDateTime startTime;
    
    @Field(type = FieldType.Date)
    private LocalDateTime endTime;
    
    @Field(type = FieldType.Integer)
    private Integer status;
    
    @Field(type = FieldType.Keyword)
    private String promotionType;
    
    @Field(type = FieldType.Keyword)
    private List<String> applicableSkus;
    
    @Field(type = FieldType.Keyword)
    private List<String> applicableCategories;
    
    @Field(type = FieldType.Double)
    private Double minPrice;
    
    @Field(type = FieldType.Double)
    private Double maxPrice;
}